<div class="tab-pane " id="weike">
    <div class="panel panel-default" role="tabpanel" style="">
        <div class="panel-heading">基本设置</div>
        <div class="panel-body">

<!--            <div class="form-group">-->
<!--                <label class="col-sm-2 col-xs-12 control-label">门店类型</label>-->
<!--                <div class="col-sm-9 col-md-8 col-lg-8 col-xs-12">-->
<!--                    <label class="radio-inline">-->
<!--                        <input name="wk_photo_type" value="0" {if !$config['wk_photo_type']} checked="checked"{/if} type="radio">儿童摄影-->
<!--                    </label>-->
<!--                    <label class="radio-inline">-->
<!--                        <input name="wk_photo_type" value="1" {if $config['wk_photo_type'] == 1} checked="checked"{/if} type="radio">婚纱摄影-->
<!--                    </label>-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label"><span style="color: red;">*</span>打call是否开启</label>
                <div class="col-sm-9 col-md-8 col-lg-8 col-xs-12">
                    {if $config['wk_call_open'] === 0}
                    <label class="radio-inline">
                        <input name="wk_call_open" value="1" type="radio">开启
                    </label>
                    <label class="radio-inline">
                        <input name="wk_call_open" value="0" checked="checked" type="radio">关闭
                    </label>
                    {else}
                    <label class="radio-inline">
                        <input name="wk_call_open" value="1" checked="checked" type="radio">开启
                    </label>
                    <label class="radio-inline">
                        <input name="wk_call_open" value="0" type="radio">关闭
                    </label>
                    {/if}
                </div>
            </div>

            <?php
                
                require_once YX_PLUGIN_CORE . 'inc/plugin_model.php';
                require_once get_path('plugin/weike/core/model.php');
                $wk_call_gift_groups = \WeikeModel::getCallGiftGroups(intval($_P['id']),false);
                $wk_gift_groups = \WeikeModel::getGiftGroups(intval($_P['id']),false);
                $wk_template = \WeikeModel::getTemplateInfo($system);
                if(!empty($wk_template) && !$config['wk_template_id']){
                    $config['wk_template_id'] = 0;
                    array_unshift($wk_template,['id'=>0,'name'=>'请选择模版','status'=>1,'config'=>'','created_at'=>'']);
                }
            ?>
            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label"><span style="color: red;">*</span>打call礼品</label>
                <div class="col-sm-9 col-md-8 col-lg-4 col-xs-12">
                    {if !empty($wk_call_gift_groups)}
                    <select class="form-control" name="wk_call_gift_group_id">
                        {loop $wk_call_gift_groups $index $item}
                        <option value="{php echo $item['id'];}" {php echo ($item['id'] == $config['wk_call_gift_group_id'])?'selected':'';}>{$item['title']}</option>
                        {/loop}
                    </select>
                    {else}
                    <select class="form-control" name="wk_call_gift_group_id">
                        <option value="0" selected="selected">未选择，默认最新修改配置的打call礼品分组</option>
                    </select>
                    {/if}
                </div>
                <div class="col-sm-9 col-md-8 col-lg-4 col-xs-12">
                    <a href="{php echo createWebUrlPlugin('weike.call.main',array('themeid'=>$_P['id']));}" >
                        <div style="margin-top: 8px;color: #2c90e6;">
                            编辑礼品
                        </div>
                    </a>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label"><span style="color: red;">*</span>打赏礼物是否开启</label>
                <div class="col-sm-9 col-md-8 col-lg-8 col-xs-12">
                    {if $config['wk_gift_open'] === 0}
                    <label class="radio-inline">
                        <input name="wk_gift_open" value="1" type="radio">开启
                    </label>
                    <label class="radio-inline">
                        <input name="wk_gift_open" value="0" checked="checked" type="radio">关闭
                    </label>
                    {else}
                    <label class="radio-inline">
                        <input name="wk_gift_open" value="1" checked="checked" type="radio">开启
                    </label>
                    <label class="radio-inline">
                        <input name="wk_gift_open" value="0" type="radio">关闭
                    </label>
                    {/if}
                </div>
            </div>



            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label"><span style="color: red;">*</span>打赏礼物</label>
                <div class="col-sm-9 col-md-8 col-lg-4 col-xs-12">
                    {if !empty($wk_gift_groups)}
                    <select class="form-control" name="wk_gift_group_id">
                        {loop $wk_gift_groups $index $item}
                        <option value="{php echo $item['id'];}" {php echo ($item['id'] == $config['wk_gift_group_id'])?'selected':'';}>{$item['title']}</option>
                        {/loop}
                    </select>
                    {else}
                    <select class="form-control" name="wk_gift_group_id">
                        <option value="0" selected="selected">未选择，默认最新修改配置的打赏礼物分组</option>
                    </select>
                    {/if}
                </div>
                <div class="col-sm-9 col-md-8 col-lg-4 col-xs-12">
                    <a href="{php echo createWebUrlPlugin('weike.gift.main',array('themeid'=>$_P['id']));}" >
                        <div style="margin-top: 8px;color: #2c90e6;">
                            编辑礼物
                        </div>
                    </a>
                </div>
            </div>

            <div class="form-group">
                <input class="form-control" type="hidden" name="wk_old_template_id" value="{$config['wk_template_id']}"/>
                <label class="col-sm-2 col-xs-12 control-label"><span style="color: red;">*</span>选择模版</label>
                <div class="col-sm-9 col-md-8 col-lg-4 col-xs-12">
                    {if !empty($wk_template)}
                    <select class="form-control" name="wk_template_id" id="wk_template_id">
                        {loop $wk_template $index $item}
                        <option value="{php echo $item['id'];}" data-id="{$item['id']}" data-tconfig="{$item['config']}" {php echo ($item['id'] == $config['wk_template_id'])?'selected':'';}>{$item['name']}</option>
                        {/loop}
                    </select>
                    {else}
                    <select class="form-control" name="wk_template_id">
                        <option value="0" selected="selected">请选择模版</option>
                    </select>
                    {/if}
                    <span class="help-block">如果选择模版，请先保存后再进行其他配置。 </span>
                </div>
            </div>


        </div>
    </div>
    <div class="panel panel-default" role="tabpanel" style="">
        <div class="panel-heading">打CALL与打赏设置</div>
        <div class="panel-body">

            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">展示好友信息</label>
                <div class="col-sm-9 col-md-8 col-lg-8 col-xs-12">
                    <label class="radio-inline">
                        <input name="wk_show_friend_info_type" value="1" {if !$config['wk_show_friend_info_type'] || $config['wk_show_friend_info_type']==1} checked="checked"{/if} type="radio">头像
                    </label>
                    <label class="radio-inline">
                        <input name="wk_show_friend_info_type" value="2" {if $config['wk_show_friend_info_type']==2} checked="checked"{/if} type="radio">手机号
                    </label>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">打call收集信息</label>
                <div class="col-sm-9 col-md-8 col-lg-8 col-xs-12">
                    <label class="radio-inline">
                        <input name="wk_call_form_type" value="0" {if $config['wk_call_form_type']==0} checked="checked"{/if} type="radio">不收集
                    </label>
                    <label class="radio-inline">
                        <input name="wk_call_form_type" value="1" {if $config['wk_call_form_type']==1 || !$config['wk_call_form_type']} checked="checked"{/if} type="radio">收集
                    </label>
<!--                    <label class="radio-inline">-->
<!--                        <input name="wk_call_form_type" value="2" {if $config['wk_call_form_type']==2} checked="checked"{/if} type="radio">手机号+姓名-->
<!--                    </label>-->
                </div>
            </div>

            <div class="form-group" >
                <label class="col-sm-2 col-xs-12 control-label"><span style="color: red;">*</span>默认打call天数</label>
                <div class="col-sm-8 col-xs-12">
                    <div class="input-group">
                        <input type="text" class="form-control"  placeholder="" name="wk_call_days"  value="{php echo empty($config['wk_call_days'])?10:$config['wk_call_days'];}">
                        <span class="input-group-addon">天</span>
                    </div>
                    <span class="help-block">提示：默认客户收集打call的天数</span>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">打call模式</label>
                <div class="col-sm-9 col-md-8 col-lg-8 col-xs-12">
                    <label class="radio-inline">
                        <input name="wk_call_type" value="0" {if !$config['wk_call_type']} checked="checked"{/if} type="radio">每人每天打call一次
                    </label>
                    <label class="radio-inline">
                        <input name="wk_call_type" value="1" {if $config['wk_call_type']==1} checked="checked"{/if} type="radio">每人只能打call一次
                    </label>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">是否允许员工打call</label>
                <div class="col-sm-9 col-md-8 col-lg-8 col-xs-12">
                    <label class="radio-inline">
                        <input name="wk_worker_call_type" value="0" {if !$config['wk_worker_call_type']} checked="checked"{/if} type="radio">不允许
                    </label>
                    <label class="radio-inline">
                        <input name="wk_worker_call_type" value="1" {if $config['wk_worker_call_type']==1} checked="checked"{/if} type="radio">允许
                    </label>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">默认打call宣言</label>
                <div class="col-sm-8 col-xs-12">
                    <textarea rows="5" cols="50" class="form-control"  name="wk_call_declaration" >{php echo empty($config['wk_call_declaration'])?"欢迎欣赏#name的大片Show，别忘了点击送我爱心哦！想和我一样拍出又萌又潮的大片吗？那就赶快领取拍摄卡吧，限量3张免费领取哦！":$config['wk_call_declaration'];}</textarea>
                    <span class="help-block">支持通配符:#name客户填写的客片名称，最多填写80个字。 </span>
                    <span class="help-block">表情符号请用微信编辑好粘贴至此即可,常用：[庆祝][烟花][呲牙][色][蛋糕][礼物][红包][福][爆竹]；</span>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">送礼物收集信息</label>
                <div class="col-sm-9 col-md-8 col-lg-8 col-xs-12">
                    <label class="radio-inline">
                        <input name="wk_gift_form_type" value="0" {if $config['wk_gift_form_type']==0} checked="checked"{/if} type="radio">不收集
                    </label>
                    <label class="radio-inline">
                        <input name="wk_gift_form_type" value="1" {if $config['wk_gift_form_type']==1 || !$config['wk_gift_form_type']} checked="checked"{/if} type="radio">收集
                    </label>
<!--                    <label class="radio-inline">-->
<!--                        <input name="wk_gift_form_type" value="2" {if $config['wk_gift_form_type']==2} checked="checked"{/if} type="radio">手机号+姓名-->
<!--                    </label>-->
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">是否允许员工打赏</label>
                <div class="col-sm-9 col-md-8 col-lg-8 col-xs-12">
                    <label class="radio-inline">
                        <input name="wk_worker_gift_type" value="0" {if !$config['wk_worker_gift_type']} checked="checked"{/if} type="radio">不允许
                    </label>
                    <label class="radio-inline">
                        <input name="wk_worker_gift_type" value="1" {if $config['wk_worker_gift_type']==1} checked="checked"{/if} type="radio">允许
                    </label>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">打赏的钱到哪？</label>
                <div class="col-sm-9 col-md-8 col-lg-8 col-xs-12">
                    <label class="radio-inline">
                        <input name="wk_gift_money_give" value="0" {if !$config['wk_gift_money_give']} checked="checked"{/if} type="radio">客户
                    </label>
                    <label class="radio-inline">
                        <input name="wk_gift_money_give" value="1" {if $config['wk_gift_money_give']==1} checked="checked"{/if} type="radio">影楼
                    </label>
                </div>
            </div>
            <div class="form-group" >
                <label class="col-sm-2 col-xs-12 control-label">打赏礼物单位</label>
                <div class="col-sm-9 col-md-8 col-lg-8 col-xs-12">
                    <div class="input-group">
                        <input type="text" class="form-control"  placeholder="" name="wk_gift_unit"  value="{php echo empty($config['wk_gift_unit'])?'金币':$config['wk_gift_unit'];}">
                        <span class="input-group-addon"></span>
                    </div>
                    <span class="help-block">送礼物的单位如：金币 星币 豆豆</span>
                </div>
            </div>
            <?php
                if(!isset($config['wk_gift_rules'])){
                    $config['wk_gift_rules'] = ['每个微信号都可以免费送一颗CALL给好友，收到CALL数越多你的好友可免费兑换好礼。','每位好友每天只能帮你打call一次。您不可以为自己打call。','你可以点击购买礼物送给好友。每个礼物价值不同数量的金币(1金币代表一元)。'];
                }
            ?>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">礼物规则：</label>
                <div class="col-sm-9 col-xs-12">
                    <table class='table'>
                        <thead>
                        <tr>
                            <th>礼物规则内容</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody id="wk_gift_rule_items">
                        {loop $config['wk_gift_rules'] $wk_gift_rule_item}
                        <tr >
                            <td class="col-sm-10 col-xs-12">
                                <input name="wk_gift_rules[]" type="text"
                                       class="form-control span3" value="{$wk_gift_rule_item}"/>
                            </td>
                            <td>
                                <a href='javascript:;' onclick='removeGiftRule(this)'>
                                    <i class='glyphicon glyphicon-remove'></i> 删除</a></td>
                        </tr>
                        {/loop}
                        </tbody>
                    </table>
                    <a href="javascript:;" onclick="addGiftRule();"><i class="glyphicon glyphicon-plus" title="添加规则"></i>添加规则</a>
                </div>
            </div>

<!--            <div class="form-group" >-->
<!--                <label class="col-sm-2 col-xs-12 control-label">收集信息标题</label>-->
<!--                <div class="col-sm-9 col-md-8 col-lg-8 col-xs-12">-->
<!--                    <div class="input-group">-->
<!--                        <input type="text" class="form-control"  placeholder="" name="wk_collect_form_title"  value="{php echo empty($config['wk_collect_form_title'])?'请留下您的信息':$config['wk_collect_form_title'];}">-->
<!--                        <span class="input-group-addon"></span>-->
<!--                    </div>-->
<!--                    <span class="help-block"></span>-->
<!--                </div>-->
<!--            </div>-->

        </div>
    </div>
    <div class="panel panel-default" role="tabpanel" style="">
        <div class="panel-heading">样式设置</div>
        <div class="panel-body">
            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">客片展示形式</label>
                <div class="col-sm-9 col-md-8 col-lg-8 col-xs-12">
                    <label class="radio-inline">
                        <input name="wk_photo_show_type" value="0" {if !$config['wk_photo_show_type']} checked="checked"{/if} type="radio">banner轮播+页面
                    </label>
                    <label class="radio-inline">
                        <input name="wk_photo_show_type" value="1" {if $config['wk_photo_show_type']==1} checked="checked"{/if} type="radio">仅banner轮播
                    </label>
                    <label class="radio-inline">
                        <input name="wk_photo_show_type" value="2" {if $config['wk_photo_show_type']==2} checked="checked"{/if} type="radio">仅页面
                    </label>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">主题色</label>
                <div class="col-sm-5 col-xs-12">
                    {php echo view_form_field_color('wk_theme_color',$config['wk_theme_color']?:'#F7E6EA');}
                    <span class="help-block"></span>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">大片show口号</label>
                <div class="col-sm-8 col-xs-12">
                    <div class="input-group">
                        <input type="text" class="form-control"  placeholder="" name="wk_show_slogan"  value="{php echo !isset($config['wk_show_slogan'])?'我的宝贝我来Show~':$config['wk_show_slogan'];}">
                        <span class="input-group-addon"></span>
                    </div>
                    <span class="help-block">提示：最多填写13个字</span>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">客片信息背景图</label>
                <div class="col-sm-8 col-xs-12">
                    {php echo view_form_field_image('wk_user_info_bg',!isset($config['wk_user_info_bg'])?'https://css2020.yixuan.net/2020css/weike/images/icon11.png':$config['wk_user_info_bg']);}
                    <span class="help-block"></span>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">打call宝贝人气</label>
                <div class="col-sm-8 col-xs-12">
                    {php echo view_form_field_image('wk_call_left_bg',!isset($config['wk_call_left_bg'])?'https://css2020.yixuan.net/2020css/weike/images/icon3_01.png':$config['wk_call_left_bg']);}
                    <span class="help-block"></span>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">打call宝贝人气图标</label>
                <div class="col-sm-8 col-xs-12">
                    {php echo view_form_field_image('wk_call_left_icon',!isset($config['wk_call_left_icon'])?'https://css2020.yixuan.net/2020css/weike/images/icon2.png':$config['wk_call_left_icon']);}
                    <span class="help-block"></span>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">打call宝贝人气内引导文字颜色</label>
                <div class="col-sm-5 col-xs-12">
                    {php echo view_form_field_color('wk_call_left_help_color',$config['wk_call_left_help_color']?:'#ffffff');}
                    <span class="help-block"></span>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">打call解锁礼品</label>
                <div class="col-sm-8 col-xs-12">
                    {php echo view_form_field_image('wk_call_right_bg',!isset($config['wk_call_right_bg'])?'https://css2020.yixuan.net/2020css/weike/images/icon16_01.png':$config['wk_call_right_bg']);}
                    <span class="help-block"></span>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">打call解锁礼品图标</label>
                <div class="col-sm-8 col-xs-12">
                    {php echo view_form_field_image('wk_call_right_icon',!isset($config['wk_call_right_icon'])?'https://css2020.yixuan.net/2020css/weike/images/icon18.png':$config['wk_call_right_icon']);}
                    <span class="help-block"></span>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">打call解锁礼品内引导文字颜色</label>
                <div class="col-sm-5 col-xs-12">
                    {php echo view_form_field_color('wk_call_right_help_color',$config['wk_call_right_help_color']?:'#ffffff');}
                    <span class="help-block"></span>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">打call中间背景</label>
                <div class="col-sm-8 col-xs-12">
                    {php echo view_form_field_image('wk_call_center_bg',!isset($config['wk_call_center_bg'])?'https://css2020.yixuan.net/2020css/weike/images/icon3_hs_02.png':$config['wk_call_center_bg']);}
                    <span class="help-block"></span>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">打call底部背景</label>
                <div class="col-sm-8 col-xs-12">
                    {php echo view_form_field_image('wk_call_bottom_bg',!isset($config['wk_call_bottom_bg'])?'https://css2020.yixuan.net/2020css/weike/images/icon3_hs_03.png':$config['wk_call_bottom_bg']);}
                    <span class="help-block"></span>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">打call按钮图片</label>
                <div class="col-sm-8 col-xs-12">
                    {php echo view_form_field_image('wk_give_call_button_img',!isset($config['wk_give_call_button_img'])?'https://css2020.yixuan.net/2020css/weike/images/icon5.png':$config['wk_give_call_button_img']);}
                    <span class="help-block"></span>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">送礼物广告图片</label>
                <div class="col-sm-8 col-xs-12">
                    {php echo view_form_field_image('wk_give_gift_ad_img',!isset($config['wk_give_gift_ad_img'])?'http://img2020.yixuansoft.cn/images/2/2022/06/w19xkUrR0jRPXdndg69197x9jU9Dn1.jpg/99.jpg':$config['wk_give_gift_ad_img']);}
                    <span class="help-block"></span>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">领取礼包广告图片</label>
                <div class="col-sm-8 col-xs-12">
                    {php echo view_form_field_image('wk_get_gift_ad_img',!isset($config['wk_get_gift_ad_img'])?'https://css2020.yixuan.net/2020css/weike/images/icon8.png':$config['wk_get_gift_ad_img']);}
                    <span class="help-block"></span>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">领取礼包悬浮按钮</label>
                <div class="col-sm-8 col-xs-12">
                    {php echo view_form_field_image('wk_get_gift_icon',!isset($config['wk_get_gift_icon'])?'https://css2020.yixuan.net/2020css/weike/images/icon17.png':$config['wk_get_gift_icon']);}
                    <span class="help-block"></span>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">内容图中领取礼包按钮</label>
                <div class="col-sm-8 col-xs-12">
                    {php echo view_form_field_image('wk_content_get_gift_button',!isset($config['wk_content_get_gift_button'])?'https://css2020.yixuan.net/2020css/weike/images/page_join.png':$config['wk_content_get_gift_button']);}
                    <span class="help-block"></span>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">内容图中领取礼包按钮位置</label>
                <div class="col-sm-8 col-xs-12">
                    <div class="input-group">
                        <span class="input-group-addon">图片宽百分比</span>
                        <input type="number" class="form-control" max="100" min="0.1" step="0.1" placeholder="" name="wk_content_get_gift_button_width"  value="{php echo !isset($config['wk_content_get_gift_button_width'])?62:$config['wk_content_get_gift_button_width'];}">
                        <span class="input-group-addon">%</span>
                        <span class="input-group-addon">距离内容图顶部距离</span>
                        <input type="number" class="form-control" min="0" placeholder="" name="wk_content_get_gift_button_top"  value="{php echo !isset($config['wk_content_get_gift_button_top'])?2594:$config['wk_content_get_gift_button_top'];}">
                        <span class="input-group-addon">rpx</span>
                    </div>
                </div>
            </div>

            <div class="form-group" >
                <label class="col-sm-2 col-xs-12 control-label">内容图中领取礼包按钮文字</label>
                <div class="col-sm-9 col-md-8 col-lg-8 col-xs-12">
                    <div class="input-group">
                        <input type="text" class="form-control"  placeholder="" name="wk_content_get_gift_button_text"  value="{php echo !isset($config['wk_content_get_gift_button_text'])?'领取新人礼包':$config['wk_content_get_gift_button_text'];}">
                        <span class="input-group-addon"></span>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="panel panel-default" role="tabpanel" style="">
        <div class="panel-heading">按扭配置</div>
        <div class="panel-body" style="">
            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">送Ta礼物别名</label>
                <div class="col-sm-6 col-xs-12">
                    <input type="text" class="form-control"  placeholder="" name="wk_button_left_text"  value="{if empty($config['wk_button_left_text'])}送Ta礼物{else}{$config['wk_button_left_text']}{/if}">
                    <!--                    <span class="help-block">如:立即免费在线报名</span>-->
                    <!--                    <span class="help-block">以下几个按扭文字支持通配符:#br带表换行 #fee表示报名费 #dan表示单买价 #tuan表示拼团价</span>-->
                </div>
                <div class="col-sm-4 col-xs-12">
                    {php echo view_form_field_color('wk_button_left_text_color',$config['wk_button_left_text_color']?:'#ffffff');}
                    <span class="help-block">送Ta礼物别名文字颜色</span>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">送Ta礼物按扭颜色</label>
                <div class="col-sm-5 col-xs-12">
                    {php echo view_form_field_color('wk_button_left_bg_color',$config['wk_button_left_bg_color']?:'#f36765');}
                    <span class="help-block">送Ta礼物按扭的背景色</span>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">领取礼包别名</label>
                <div class="col-sm-6 col-xs-12">
                    <div class="input-group">
                    <input type="text" class="form-control"  placeholder="" name="wk_button_right_text"  value="{if empty($config['wk_button_right_text'])}领取礼包{else}{$config['wk_button_right_text']}{/if}">
                    <span class="input-group-addon">客户自己分享给好友别名</span>
                    <input type="text" class="form-control"  placeholder="" name="wk_button_ismy_text"  value="{if empty($config['wk_button_ismy_text'])}分享给好友{else}{$config['wk_button_ismy_text']}{/if}">
                    </div>
                </div>
                <div class="col-sm-4 col-xs-12">
                    {php echo view_form_field_color('wk_button_right_text_color',$config['wk_button_right_text_color']?:'#ffffff');}
                    <span class="help-block">领取礼包文字颜色</span>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">领取礼包按扭颜色</label>
                <div class="col-sm-5 col-xs-12">
                    {php echo view_form_field_color('wk_button_right_bg_color',$config['wk_button_right_bg_color']?:'#DC2A21');}
                    <span class="help-block">领取礼包按扭的背景色</span>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">表单提交按扭文字</label>
                <div class="col-sm-6 col-xs-12">
                    <div class="input-group">
                    <input type="text" class="form-control"  placeholder="" name="wk_button_form_text"  value="{if empty($config['wk_button_form_text'])}立即领取{else}{$config['wk_button_form_text']}{/if}">
                    <span class="input-group-addon">客户自己邀请好友领取别名</span>
                    <input type="text" class="form-control"  placeholder="" name="wk_button_form_ismy_text"  value="{if empty($config['wk_button_form_ismy_text'])}邀请好友领取{else}{$config['wk_button_form_ismy_text']}{/if}">
                    </div>
                </div>
                <div class="col-sm-4 col-xs-12">
                    {php echo view_form_field_color('wk_button_form_text_color',$config['wk_button_form_text_color']?:'#ffffff');}
                    <span class="help-block">表单提交按扭文字颜色</span>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">表单提交按扭颜色</label>
                <div class="col-sm-5 col-xs-12">
                    {php echo view_form_field_color('wk_button_form_bg_color',$config['wk_button_form_bg_color']?:'#FF526D');}
                    <span class="help-block">表单提交按扭的背景色</span>
                </div>
            </div>

            <div class="form-group" >
                <label class="col-sm-2 col-xs-12 control-label">表单报名按钮下方提示</label>
                <div class="col-sm-8 col-xs-12">
                    <div class="input-group">
                        <input type="text" class="form-control"  placeholder="" name="wk_buy_button_tips"  value="{php echo empty($config['wk_buy_button_tips'])?'':$config['wk_buy_button_tips'];}">
                        <span class="input-group-addon"></span>
                    </div>
                    <span class="help-block">例如：仅限新客领取，否则将原路退还报名费。</span>
                </div>
            </div>
        </div>

    </div>
    <div class="panel panel-default" role="tabpanel" style="">
        <div class="panel-heading"> 特权礼包配置 </div>
        <div class="panel-body">
            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">特权礼包背景图</label>
                <div class="col-sm-8 col-xs-12">
                    {php echo view_form_field_image('wk_gift_bag_bg',!isset($config['wk_gift_bag_bg'])?'https://css2020.yixuan.net/2020css/weike/images/icon31.png':$config['wk_gift_bag_bg']);}
                    <span class="help-block"></span>
                </div>
            </div>
            <?php
                if(!isset($config['wk_gift_bags'])){
                    $config['wk_gift_bags'] = ['6寸精美新款相册1本','8寸摆台1幅','精修精调入册6张','服装2套精致造型2款'];
                }
            ?>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">特权礼包：</label>
                <div class="col-sm-9 col-xs-12">
                    <table class='table'>
                        <thead>
                        <tr>
                            <th>特权礼包内容</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody id="wk_gift_bag_items">
                        {loop $config['wk_gift_bags'] $wk_gift_bag_item}
                        <tr >
                            <td class="col-sm-10 col-xs-12">
                                <input name="wk_gift_bags[]" type="text"
                                       class="form-control span3" value="{$wk_gift_bag_item}"/>
                            </td>
                            <td>
                                <a href='javascript:;' onclick='removeGiftBag(this)'>
                                    <i class='glyphicon glyphicon-remove'></i> 删除</a></td>
                        </tr>
                        {/loop}
                        </tbody>
                    </table>
                    <a href="javascript:;" onclick="addGiftBag();"><i class="glyphicon glyphicon-plus" title="添加礼包内容"></i>添加礼包内容</a>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">特权礼包内容文字颜色</label>
                <div class="col-sm-5 col-xs-12">
                    {php echo view_form_field_color('wk_gift_bags_text_color',$config['wk_gift_bags_text_color']?:'#D63471');}
                    <span class="help-block"></span>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 col-xs-12 control-label">倒计时背景图</label>
                <div class="col-sm-8 col-xs-12">
                    {php echo view_form_field_image('wk_time_bg',!isset($config['wk_time_bg'])?'https://css2020.yixuan.net/2020css/weike/images/icon23.png':$config['wk_time_bg']);}
                    <span class="help-block"></span>
                </div>
            </div>

            <div class="form-group" >
                <label class="col-sm-2 col-xs-12 control-label">领取礼包限量配置</label>
                <div class="col-sm-8 col-xs-12">
                    <div class="input-group">
                        <input type="text" class="form-control"  placeholder="" name="wk_buy_limit"  value="{php echo (!isset($config['wk_buy_limit']) || $config['wk_buy_limit'] === null)?3:$config['wk_buy_limit'];}">
                        <span class="input-group-addon"></span>
                    </div>
                    <span class="help-block">提示：0表示不限制，大于0表示可通过客片链接购买的数量。</span>
                </div>
                {if $config['maxcountall']>1 || $config['maxcountall2']>1}
                <div class="col-sm-1 col-xs-12">
                    <a href="{php echo createWebUrl('record',array('op'=>'RenewTuan','id'=>$theme['id']));}" class="btn btn-info"> 更新团人数</a>
                </div>
                {/if}
            </div>


        </div>
    </div>

    {if $_G['isSuperAdmin']}
    {else}
    {/if}
</div>

<script>
    // $("#wk_template_id").change(function () {
    //     let tmp_id = $(this).val();
    //     console.log(tmp_id,1221)
    //     if(tmp_id > 0){
    //         let tmp_config = '';
    //         $(this).find('option').each((index, item) => {
    //             if($(item).data('id') == tmp_id) {
    //                 tmp_config = $(item).data('tconfig');
    //             }
    //         });
    //         if(tmp_config){
    //             //挨个赋值
    //
    //
    //         }
    //     }
    // })
    function addGiftRule() {
        var html = "<tr>";
        html += '<td class="col-sm-10 col-xs-12"><input name="wk_gift_rules[]" type="text" class="form-control span3" value="" /></td>';
        html += '<td><a href="javascript:;" onclick="removeGiftRule(this)" ><i class="glyphicon glyphicon-remove"></i> 删除</a></td>';
        html += "</tr>";
        $("#wk_gift_rule_items").append(html);
    }
    function removeGiftRule(obj) {
        $(obj).parent().parent().remove();
    }
    function addGiftBag() {
        var html = "<tr>";
        html += '<td class="col-sm-10 col-xs-12"><input name="wk_gift_bags[]" type="text" class="form-control span3" value="" /></td>';
        html += '<td><a href="javascript:;" onclick="removeGiftBag(this)" ><i class="glyphicon glyphicon-remove"></i> 删除</a></td>';
        html += "</tr>";
        $("#wk_gift_bag_items").append(html);
    }
    function removeGiftBag(obj) {
        $(obj).parent().parent().remove();
    }
</script>